'''
Created on 14/07/2010

@author: eh01
'''
from datastore.uri import Uri
from runtime.service import Service
from datastore.resource import Resource

class AdaptorHomeService(Service):

    SPEAR_ADAPTOR_HEADER = "SPEAR Adaptor"
    
    def cb_start(self, uri, action, res):      
        self.spaces.set_process(Uri('external:adaptor'), self.cb_adaptor_home)
        
    def cb_adaptor_home(self, uri, action, res):
        if action == 'get':
            res =  Resource(type="term:eplanning/adaptor/home/get/data")
            res.h1_header = AdaptorHomeService.SPEAR_ADAPTOR_HEADER
            return res
        elif action == 'exists':
            return True
        else:
            return